<template>
	<view class="container">
		<!-- 分销中心 -->
		<view>
			<view style="margin: 10px;">
				<view class="menu_title">
					<view class="title_left">分销中心</view>
					<view class="title_right" @click="toOtherPage(1)">查看详情	<image class="arrowsIcon" src="../../static/person/fanhui.png" alt=""/></view>
				</view>
				<view style="padding: 0 15px;color: #9D9C9C;font-size: 12px;">
					自购省钱，推广赚钱
				</view>
			</view>
		</view>
		<view style="width: 100vw;height: 8px;background-color: #EFEFEF;"></view>
		<!-- 我的团队 -->
		<view>
			<view style="margin: 10px;">
				<view class="menu_title">
					<view class="title_left">我的团队</view>
					<view class="title_right" @click="toOtherPage(2)">团队人数<text v-if="userInfo.teams_count!=undefined" style="margin-left: 5px;"> {{userInfo.teams_count}}</text><image class="arrowsIcon" src="../../static/person/fanhui.png" alt=""/></view>
				</view>
				<view style="padding: 0 15px;color: #9D9C9C;font-size: 12px;">
					分享海报，邀请更多小伙伴加入
				</view>
			</view>
		</view>
		<view style="width: 100vw;height: 8px;background-color: #EFEFEF;"></view>
	</view>
</template>

<script>
import {
  mapState
} from 'vuex';
	export default{
		props: {
			userInfo: ''
		},
		data() {
			return{

			}
		},
    computed: {
      ...mapState(['token']),
    },
		methods: {
			//1为分销中心 2为我的团队
			toOtherPage(num){
				if(this.token){
					if(num==1){
						wx.navigateTo({
							url:"/pages/my/distribution_centre/distribution_centre"
						})
					}else if(num==2){
						wx.navigateTo({
							url:"/pages/my/myTeam/myTeam"
						})
					}
				}else{
					wx.showToast({
						title:"请先登陆",
						icon:"none"
					})
				}
			},
		}
	}
</script>

<style lang="scss" scoped>

	.arrowsIcon{
		width: 7px;height: 12px;margin-left: 10px;vertical-align: middle;
	}
	.menu_title{
		width: 100%;
		display: flex;
		height: 30px;
		padding-bottom: 10px;
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
	}
	.menu_title>.title_left{
		font-size: 15px;
		padding: 0 15px;
		// font-weight: bold;
	}
	.menu_title>.title_right{
		margin-left: auto;
		padding: 5px 15px;
		font-size: 12px;
		color: #666666;
		/*color: #aaaaaa;*/
	}

</style>
